<script setup lang="ts">
  import { genTestUserSig } from '../debug/GenerateTestUserSig.js'
  import { useStore } from 'vuex'
  import { ref, computed, getCurrentInstance, onUpdated } from 'vue'
  const { proxy } = getCurrentInstance()
  const concatTim = () => {
    const token = localStorage.getItem('token')
    const userInfo = JSON.parse(localStorage.getItem('userinfo'))
    if (token) {
      const userID = userInfo.phone
      let promise = proxy.tim.login({
        userID: userID,
        userSig: genTestUserSig(userID).userSig
      })
      promise
        .then(function (imResponse) {
          console.log('imResponse.data==>', imResponse.data) // 登录成功
          if (imResponse.data.repeatLogin === true) {
            // 标识帐号已登录，本次登录操作为重复登录。v2.5.1 起支持
            console.log(imResponse.data.errorInfo)
          }
        })
        .catch(function (imError) {
          console.warn('login error:', imError) // 登录失败的相关信息
        })
    }
  }
</script>

<template>

  <!-- <HelloWorld msg="Vite + Vue" /> -->
  <router-view />
</template>

<style scoped  lang="scss">
#app {
  max-width: 750px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  min-width: 320px;
}
</style>
